<script>
;(()=>{
    var t = "production"
      , e = {
        copied: "Copied",
        copy: "复制"
    };
    console.debug(`Environment: ${t}`);
    async function n(e, t) {
        const n = t.textContent;
        try {
            "clipboard"in navigator ? await navigator.clipboard.writeText(n) : console.error("Failed to copy. Dead browser.")
        } catch {
            console.error("Failed to copy. Check permissions...")
        } finally {
            s(e)
        }
    }
    function s(t) {
        t.innerHTML = e.copied,
        setTimeout(()=>{
            t.innerHTML = e.copy
        }
        , 2e3)
    }
    window.addEventListener("DOMContentLoaded", ()=>{
        document.querySelectorAll("pre > code").forEach(t=>{
            const i = t.parentNode.parentNode
              , s = document.createElement("button");
            let a = ["copy-button"];
            s.classList.add(...a),
            s.innerHTML = e.copy;
            let o;
            i.classList.contains("highlight") ? o = i : t.parentNode.parentNode.parentNode.parentNode.parentNode.nodeName === "TABLE" ? o = t.parentNode.parentNode.parentNode.parentNode.parentNode : (t.parentElement.classList.add("highlight"),
            o = t.parentNode),
            s.addEventListener("click", ()=>n(s, o)),
            o.appendChild(s)
        }
        )
    }
    )
}
)();
</script>